﻿using PMS.Core.Configuration.CommonEnumConfigs;
using PMS.Web.Framework.Models;
using System.Collections.Generic;

namespace PMS.Web.Models.NaviMenus
{
    public class LayoutTemplateSelectModel : BaseEntityModel, IXMSelectModel
    {
        public string Name { get; set; }
        public string Value
        {
            get => Id.ToString();
            set
            {
                if (Id > 0) return;
                if (int.TryParse(value, out int templateId))
                    Id = templateId;
            }
        }
        public LayoutTemplateType TemplateType { get; set; }
        public string TemplatePreviewImageUrl { get; set; }
        public int Order { get; set; }
        public bool Selected { get; set; }
        public bool Disabled { get; set; }
        public IList<LayoutTemplateSelectModel> Children { get; set; }
    }
}
